<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% String path = request.getContextPath();%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>等你回家</title>
    <link href="<%=path%>/web/index/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
    <link href="<%=path %>/web/index/css/style.css" rel="stylesheet" type="text/css" media="all"/>
<%--    <link rel="icon" href="<%=path%>/web/static/images/favicon.png" type="image/png" sizes="32x32">--%>

    <link href="<%=path%>/web/static/css/blog.css" rel="stylesheet">
    <link href="<%=path%>/web/index/css/base.css" rel="stylesheet">
    <link href="<%=path%>/web/index/css/index.css" rel="stylesheet">
    <link href="<%=path%>/web/index/css/task.css" rel="stylesheet">
<%--    <link rel="stylesheet" href="<%=path%>/web/static/css/style.css">--%>
</head>
<body style="background: #f7f7f7">
<!--header-->
<div class="banner-in">
    <div class="container">
        <h6>等你回家 / <span>日志列表</span></h6>
    </div>
</div>
<!--header-->
<div class="header">
    <div class="container">
        <div class="logo">
            <a href="index.html"><img src="<%=path %>/web/index/images/logo.png" alt=" " /></a>
        </div>
        <div class="top-nav">
            <span class="menu"> </span>
            <ul>
                <li><a href="<%=path %>/web/index" class="scroll">首页</a></li>
                <li><a href="<%=path %>/web/information/chooseType" class="scroll">你在哪儿</a></li>
                <li><a href="<%=path %>/web/information/informationList?lostTypeId=0" class="scroll">我想回家</a></li>
                <li  class="active" ><a href="<%=path %>/web/blogger/blog" class="scroll">日志论坛</a></li>
                <li><a href="<%=path %>/web/task/releaseTask" class="scroll">任务列表</a></li>
                <c:if test="${empty(sessionScope.userinfo)}" var="result">
                    <li><a href="<%=path %>/web/userinfo/register" class="scroll">注册</a>|<a href="<%=path %>/web/userinfo/login" class="scroll">登录</a></li>
                </c:if>
                <c:if test="${not result}">
                    <li><a href="<%=path%>/web/userinfo/applyVolunteer" class="scroll">加入我们</a></li>
                    <c:if test="${(sessionScope.userinfo.username eq '')||(sessionScope.userinfo.username eq NULL)}" var="result">
                        <span style="color:white">欢迎<a href="<%=path %>/web/userinfo/index" style="color: white" href="">${sessionScope.userinfo.phone}</a></span>
                    </c:if>
                    <c:if test="${not result}">
                        <span style="color:white">欢迎<a href="<%=path %>/web/userinfo/index" style="color: white" href="">${sessionScope.userinfo.username}</a></span>
                    </c:if>
                    <span style="color: white">|</span>

                    <span style="color:white"><a style="color: white" href="<%=path %>/web/userinfo/logout">注销</a></span>
                    <span style="color: white">|</span>
                    <label><img style="width:30px;height: 30px" src="<%=path %>/web/uploadImages/${sessionScope.userinfo.pic}"></label>
                </c:if>
            </ul>
            <!--script-->
        </div>
        <div class="clearfix"> </div>
    </div>
</div>
<!---->
<!--content-->
<article>
    <div class="leftbox">
        <div class="newblogs main-content-area">


        </div>
    </div>
    <div style="margin-left: 55px;"  class="col-md-3">
        <div class="store-right">
            <h6 class="Task"><a href="${pageContext.request.contextPath}/web/blogger/fabu">发表日志</a> </h6>

            <div class="dianzanss">
                <input id="sousuo" placeholder="请输入关键字" class="Search"  type="text">
                <input id="anniu" value="搜索" class="input_submit" type="submit">
            </div>
        </div>
        <div class="store-right">
            <h6>今日最热</h6>
            <ul class="store-men">
                <c:forEach begin="0" end="4" var="i">
                    <li><a href="${pageContext.request.contextPath}/web/blogger/blogs?id=${requestScope.journals[i].id}"><span> </span>${requestScope.journals[i].title}</a></li>
                </c:forEach>
            </ul>
        </div>
    </div>

</article>
<footer>
    <div class="footer" >
        <div class="container" >
            <p style="font-size: 15px;"><span style="font-size: 20px;">等你回家</span><span>邮箱:1111111@163.com</span>
                电话:0532—85025005</p>
            <p class="footer-class" style="font-size:15px;margin-top: -10px">地址:山东省青岛市市南区中联创意广场B1栋三楼 <a
                    href="http://w3layouts.com/" target="_blank">万码学堂</a></p>
            <p class="footer-class" style="font-size:15px;margin-top: -30px;text-transform: none">Copyright © 2019
                www.dengnihuijia.com All rights Reserved.</p>
        </div>
    </div>
</footer>
</body>
<script src="<%=path %>/web/static/js/modules/jquery-3.4.1.min.js"></script>
</html>
<script>
$(function () {
    initData(1);//查找所有日志
    $(".main-content-area").on("click", ".pagelist a", function () { //给页码加点击事件
        var pageNum = $(this).data("id");
        initData(pageNum);
        return false;
    })
    $(".dianzanss").on("click","#anniu",function () {//solar搜索
        var title = $("#sousuo").val();
        var pageNum=1;
        sousuoDate(pageNum,title);
        return false;
    })
    $(".main-content-area").on("click",".pagelist1 a",function () {//solar搜索页面加点击事件
        var pageNum = $(this).data("id");
        var title = $("#sousuo").val();
        // alert(title)
        // alert(pageNum)
        sousuoDate(pageNum,title);
        return false;
    })
})

    function initData(pageNum) {   //页码
        var pageNum = {pageNum: pageNum};
        $.get("${pageContext.request.contextPath}/web/blogger/bloggers", pageNum, function (mes) {
                $(".main-content-area").empty();
                $(".main-content-area").html(mes);
            }
        );
    }
    function sousuoDate(pageNum,title) {//搜索页码加事件
        $.get("${pageContext.request.contextPath}/web/blogger/souSuo", {
            pageNum: pageNum,
            title: title
        }, function (mes) {
            $(".main-content-area").empty();
            $(".main-content-area").html(mes);
        })
    }

</script>



























